Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@commitlint/format
Advanced tools
@commitlint/format is a package used to format commit messages according to specified rules. It is part of the commitlint suite, which helps enforce consistent commit message conventions.
Format Commit Messages
This feature allows you to format the results of commit message linting. The `format` function takes an object with a `results` array and returns a formatted string that can be logged or displayed.
const { format } = require('@commitlint/format');
const results = [
{ valid: true, errors: [], warnings: [] },
{ valid: false, errors: [{ message: 'type may not be empty' }], warnings: [] }
];
const output = format({ results });
console.log(output);
Commitizen is a tool that helps you write consistent commit messages by providing an interactive prompt. Unlike @commitlint/format, which focuses on formatting and linting commit messages, Commitizen guides you through the process of writing them.
Conventional Changelog is a tool that generates changelogs based on commit messages that follow a specific convention. While @commitlint/format is used for formatting commit messages, Conventional Changelog focuses on generating changelogs from those messages.
Semantic Release automates the versioning and package publishing process based on commit messages. It uses commit message conventions to determine the type of release. Unlike @commitlint/format, which is used for formatting commit messages, Semantic Release automates the release process.
Format commitlint reports
npm install --save @commitlint/format
const format = require('@commitlint/format').default;
const output = format(
{
valid: false,
errorCount: 1,
warningCount: 1,
results: [
{
valid: false,
input: 'some: commit message',
errors: [
{
valid: false,
level: 2,
name: 'some-error',
message: 'This will show up red as it has level 2',
},
],
warnings: [
{
valid: true,
level: 0,
name: 'some-hint',
message: 'This will not show up as it has level 0',
},
{
valid: false,
level: 1,
name: 'some-warning',
message: 'This will show up yellow as it has level 1',
},
],
},
],
},
{
color: false,
}
);
process.stdout.write(output);
/* => [
'✖ This will show up red as it has level 2 [some-error]',
' This will not show up as it has level 0 [some-hint]',
'⚠ This will show up yellow as it has level 1 [some-warning]',
'✖ found 1 problems, 2 warnings'
] */
Consult docs/api for comprehensive documentation.
13.2.0 (2021-09-28)
conventional-commits-parser
(#2776) (a351801)FAQs
Format commitlint reports
The npm package @commitlint/format receives a total of 2,363,759 weekly downloads. As such, @commitlint/format popularity was classified as popular.
We found that @commitlint/format demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.